package com.cskaoyan.demo7.service;

import com.cskaoyan.demo7.bean.model.MarketGoodsProduct;
import com.cskaoyan.demo7.bean.model.MarketGoodsProductExample;
import com.cskaoyan.demo7.mapper.MarketGoodsProductMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description：
 * @Author：BLUEBLANK
 * @Date：2024/4/24 18:08
 */

@Service("goodsProductService")
public class GoodsProductServiceImpl implements GoodsProductService {
    @Autowired
    private MarketGoodsProductMapper goodsProductMapper;
    @Override
    public MarketGoodsProduct selectByPrimaryKey(Integer productId) {
        MarketGoodsProductExample goodsProductExample = new MarketGoodsProductExample();
        goodsProductExample.createCriteria().andIdEqualTo(productId).andDeletedEqualTo(false);
        List<MarketGoodsProduct> marketGoodsProducts = goodsProductMapper.selectByExample(goodsProductExample);
        return marketGoodsProducts.isEmpty() ? null : marketGoodsProducts.get(0);
    }
}
